package com.example.demo.shengcheng;

import java.util.Arrays;
import java.util.Random;

public class NameGenerator {

    public static  String[] MALE_FIRST_NAMES = {"张", "王", "李", "赵", "陈", "刘", "杨", "黄", "吴", "周", "徐", "孙", "胡", "朱", "高", "林", "郑", "谢", "罗", "郭", "马", "何", "王", "张", "程", "史", "吕", "曹", "丁", "任", "卢", "柳", "叶", "韩", "秦", "许", "田", "袁", "钟", "唐", "贺", "邓", "陆", "汪", "范"};
    public static  String[] FEMALE_FIRST_NAMES = {"李", "王", "张", "刘", "陈", "杨", "黄", "吴", "赵", "周", "徐", "孙", "胡", "朱", "高", "林", "郑", "谢", "罗", "郭", "马", "何", "梁", "宋", "许", "韩", "邓", "曹", "彭", "曾", "肖", "田", "董", "袁", "潘", "于", "蔡", "余", "杜", "叶", "程", "姚", "苏", "魏", "吕", "冯", "毛"};
    public static  String[] LAST_NAMES = {"王", "李", "张", "刘", "陈", "杨", "黄", "吴", "赵", "周", "徐", "孙", "胡", "朱", "高", "林", "郑", "谢", "罗", "郭", "马", "何", "梁", "宋", "许", "韩", "邓", "曹", "彭", "曾", "肖", "田", "董", "袁", "潘", "于", "蔡", "余", "杜", "叶", "程", "姚", "苏", "魏", "吕", "冯", "毛"};

    public static void main(String[] args) {
        String[] maleNames = generateNames(MALE_FIRST_NAMES, LAST_NAMES, 100);
        String[] femaleNames = generateNames(FEMALE_FIRST_NAMES, LAST_NAMES, 100);
        System.out.println("200个男生名字：" + Arrays.toString(maleNames));
        System.out.println("200个女生名字：" + Arrays.toString(femaleNames));
    }

    public static String[] generateNames(String[] firstNames, String[] lastNames, int num) {
        Random random = new Random();
        String[] names = new String[num];
        for (int i = 0; i < num; i++) {
            String firstName = firstNames[random.nextInt(firstNames.length)];
            String lastName = lastNames[random.nextInt(lastNames.length)];
            names[i] = firstName + lastName;
        }
        return names;
    }
}

